1. Field of the Invention
The present invention relates to a method of and an apparatus for sorting records, which are ordered at random, according to a specific rule without moving the records, thereby forming a sort string.
2. Description of the Related Art
There are known various methods of sorting, according to specific rules, records stored at random in a file. When such records are sorted by, for example, a divisional method to form a sort string, the records are read out from the file and stored in a main memory in a computer system. Then, a boundary value necessary for dividing the records is set, and sort condition data of each record is compared with the boundary value. According to the result of comparison, a record having the sort condition data equal to or larger than the boundary data is moved to a right region of the main memory and a record having the sort condition data smaller than the boundary data is moved to a left region thereof. A similar process is repeatedly performed for all the records to form a well-ordered sort string in the main memory.
However, in the above sorting method, the records are actually moved for sorting. When the data length of the records is large, a considerable time is taken for the movement of the records. Consequently, the sorting process takes a long time.